import { m as mpMixin, a as mixin, _ as _export_sfc, j as resolveEasycom, J as __easycom_0, k as resolveDynamicComponent, c as createBlock, o as openBlock, w as withCtx, b as createVNode, i as index$g, r as renderSlot, g as createElementBlock, F as Fragment, h as renderList, n as normalizeStyle, e as createCommentVNode, s as index$i, t as createTextVNode, u as toDisplayString, x as useMainStore, y as storeToRefs, z as ref, al as useNavbarHeight, B as onLoad, U as onShow, H as unref, p as index$q, M as withModifiers, Q as index$x, a8 as showModal, a3 as showToast, I as switchTab, ag as navigateBack, a1 as navigateTo } from './index-Cc4oxzDN.js';
import { _ as __easycom_4$1 } from './uv-empty.ob-CT4XT.js';
import { a as addressAll, b as addressDelete, s as shopGetDistanceFromLocation } from './address.47BWBG0i.js';

const MIN_DISTANCE = 10;

function getDirection(x, y) {
    if (x > y && x > MIN_DISTANCE) {
        return 'horizontal'
    }
    if (y > x && y > MIN_DISTANCE) {
        return 'vertical'
    }
    return ''
}

const touch = {
    methods: {
        getTouchPoint(e) {
            if (!e) {
                return {
                    x: 0,
                    y: 0
                }
            } if (e.touches && e.touches[0]) {
                return {
                    x: e.touches[0].pageX,
                    y: e.touches[0].pageY
                }
            } if (e.changedTouches && e.changedTouches[0]) {
                return {
                    x: e.changedTouches[0].pageX,
                    y: e.changedTouches[0].pageY
                }
            }
            return {
                x: e.clientX || 0,
                y: e.clientY || 0
            }
        },
        resetTouchStatus() {
            this.direction = '';
            this.deltaX = 0;
            this.deltaY = 0;
            this.offsetX = 0;
            this.offsetY = 0;
        },
        touchStart(event) {
            this.resetTouchStatus();
            const touch = this.getTouchPoint(event);
            this.startX = touch.x;
            this.startY = touch.y;
        },
        touchMove(event) {
            const touch = this.getTouchPoint(event);
            this.deltaX = touch.x - this.startX;
            this.deltaY = touch.y - this.startY;
            this.offsetX = Math.abs(this.deltaX);
            this.offsetY = Math.abs(this.deltaY);
            this.direction =				this.direction || getDirection(this.offsetX, this.offsetY);
        }
    }
};

const props$1 = {
	props: {
		// 控制打开或者关闭
		show: {
			type: Boolean,
			default: false
		},
		// 标识符，如果是v-for，可用index索引值
		name: {
			type: [String, Number],
			default: ''
		},
		// 是否禁用
		disabled: {
			type: Boolean,
			default: false
		},
		// 是否自动关闭其他swipe按钮组
		autoClose: {
			type: Boolean,
			default: true
		},
		// 滑动距离阈值，只有大于此值，才被认为是要打开菜单
		threshold: {
			type: Number,
			default: 20
		},
		// 右侧按钮内容
		options: {
			type: Array,
			default: () => []
		},
		// 动画过渡时间，单位ms
		duration: {
			type: [String, Number],
			default: 300
		},
		...uni.$uv?.props?.swipeActionItem
	}
};

const wxs = {
    methods: {
        // 关闭时执行
        closeHandler() {
            this.status = 'close';
        },
        setState(status) {
            this.status = status;
        },
        closeOther() {
            // 尝试关闭其他打开的单元格
            this.parent && this.parent.closeOther(this);
        }
    }
};

/**
 * 此为wxs模块，只支持APP-VUE，微信和QQ小程序以及H5平台
 * wxs内部不支持es6语法，变量只能使用var定义，无法使用解构，箭头函数等特性
 */

// 开始触摸
function touchstart(event, ownerInstance) {
	// 触发事件的组件的ComponentDescriptor实例
	var instance = event.instance;
	// wxs内的局部变量快照，此快照是属于整个组件的，在touchstart和touchmove事件中都能获取到相同的结果
	var state = instance.getState();
	if (state.disabled) return
	var touches = event.touches;
	// 如果进行的是多指触控，不允许进行操作
	if (touches && touches.length > 1) return
	// 标识当前为滑动中状态
	state.moving = true;
	// 记录触摸开始点的坐标值
	state.startX = touches[0].pageX;
	state.startY = touches[0].pageY;
	
	ownerInstance.callMethod('closeOther');
}

// 触摸滑动
function touchmove(event, ownerInstance) {
	// 触发事件的组件的ComponentDescriptor实例
	var instance = event.instance;
	// wxs内的局部变量快照
	var state = instance.getState();
	if (state.disabled || !state.moving) return
	var touches = event.touches;
	var pageX = touches[0].pageX;
	var pageY = touches[0].pageY;
	var moveX = pageX - state.startX;
	var moveY = pageY - state.startY;
	var buttonsWidth = state.buttonsWidth;

	// 移动的X轴距离大于Y轴距离，也即终点与起点位置连线，与X轴夹角小于45度时，禁止页面滚动
	if (Math.abs(moveX) > Math.abs(moveY) || Math.abs(moveX) > state.threshold) {
		event.preventDefault && event.preventDefault();
		event.stopPropagation && event.stopPropagation();
	}
	// 如果移动的X轴距离小于Y轴距离，也即终点位置与起点位置连线，与Y轴夹角小于45度时，认为是页面上下滑动，而不是左右滑动单元格
	if (Math.abs(moveX) < Math.abs(moveY)) return

	// 限制右滑的距离，不允许内容部分往右偏移，右滑会导致X轴偏移值大于0，以此做判断
	// 此处不能直接return，因为滑动过程中会缺失某些关键点坐标，会导致错乱，最好的办法就是
	// 在超出后，设置为0
	if (state.status === 'open') {
		// 在开启状态下，向左滑动，需忽略
		if (moveX < 0) moveX = 0;
		// 想要收起菜单，最大能移动的距离为按钮的总宽度
		if (moveX > buttonsWidth) moveX = buttonsWidth;
		// 如果是已经打开了的状态，向左滑动时，移动收起菜单
		moveSwipeAction(-buttonsWidth + moveX, instance, ownerInstance);
	} else {
		// 关闭状态下，右滑动需忽略
		if (moveX > 0) moveX = 0;
		// 滑动的距离不允许超过所有按钮的总宽度，此时只能是左滑，最终设置按钮的总宽度，同时为负数
		if (Math.abs(moveX) > buttonsWidth) moveX = -buttonsWidth;
		// 只要是在滑过程中，就不断移动单元格内容部分，从而使隐藏的菜单显示出来
		moveSwipeAction(moveX, instance, ownerInstance);
	}
}

// 触摸结束
function touchend(event, ownerInstance) {
	// 触发事件的组件的ComponentDescriptor实例
	var instance = event.instance;
	// wxs内的局部变量快照
	var state = instance.getState();
	if (!state.moving || state.disabled) return
	var touches = event.changedTouches ? event.changedTouches[0] : {};
	var pageX = touches.pageX;
	touches.pageY;
	var moveX = pageX - state.startX;
	if (state.status === 'open') {
		// 在展开的状态下，继续左滑，无需操作
		if (moveX < 0) return
		// 在开启状态下，点击一下内容区域，moveX为0，也即没有进行移动，这时执行收起菜单逻辑
		if (moveX === 0) {
			return closeSwipeAction(instance, ownerInstance)
		}
		// 在开启状态下，滑动距离小于阈值，则默认为不关闭，同时恢复原来的打开状态
		if (Math.abs(moveX) < state.threshold) {
			openSwipeAction(instance, ownerInstance);
		} else {
			// 如果滑动距离大于阈值，则执行收起逻辑
			closeSwipeAction(instance, ownerInstance);
		}
	} else {
		// 在关闭的状态下，右滑，无需操作
		if (moveX > 0) return
		// 理由同上
		if (Math.abs(moveX) < state.threshold) {
			closeSwipeAction(instance, ownerInstance);
		} else {
			openSwipeAction(instance, ownerInstance);
		}
	}
}

// 获取过渡时间
function getDuration(value) {
	if (value.toString().indexOf('s') >= 0) return value
	return value > 30 ? value + 'ms' : value + 's'
}

// 移动滑动选择器内容区域，同时显示出其隐藏的菜单
function moveSwipeAction(moveX, instance, ownerInstance) {
	instance.getState();
	// 获取所有按钮的实例，需要通过它去设置按钮的位移
	ownerInstance.selectAllComponents('.uv-swipe-action-item__right__button');

	// 设置菜单内容部分的偏移
	instance.requestAnimationFrame(function() {
		instance.setStyle({
			// 设置translateX的值
			'transition': 'none',
			transform: 'translateX(' + moveX + 'px)',
			'-webkit-transform': 'translateX(' + moveX + 'px)'
		});
	});
}

// 一次性展开滑动菜单
function openSwipeAction(instance, ownerInstance) {
	var state = instance.getState();
	// 获取所有按钮的实例，需要通过它去设置按钮的位移
	ownerInstance.selectAllComponents('.uv-swipe-action-item__right__button');
	// 处理duration单位问题
	var duration = getDuration(state.duration);
	// 展开过程中，是向左移动，所以X的偏移应该为负值
	var buttonsWidth = -state.buttonsWidth;
	instance.requestAnimationFrame(function() {
		// 设置菜单主体内容
		instance.setStyle({
			'transition': 'transform ' + duration,
			'transform': 'translateX(' + buttonsWidth + 'px)',
			'-webkit-transform': 'translateX(' + buttonsWidth + 'px)',
		});
	});
	setStatus('open', instance, ownerInstance);
}

// 标记菜单的当前状态，open-已经打开，close-已经关闭
function setStatus(status, instance, ownerInstance) {
	var state = instance.getState();
	state.status = status;
	ownerInstance.callMethod('setState', status);
}

// 一次性收起滑动菜单
function closeSwipeAction(instance, ownerInstance) {
	var state = instance.getState();
	// 获取所有按钮的实例，需要通过它去设置按钮的位移
	var buttons = ownerInstance.selectAllComponents('.uv-swipe-action-item__right__button');
	var len = buttons.length;
	// 处理duration单位问题
	var duration = getDuration(state.duration);
	instance.requestAnimationFrame(function() {
		// 设置菜单主体内容
		instance.setStyle({
			'transition': 'transform ' + duration,
			'transform': 'translateX(0px)',
			'-webkit-transform': 'translateX(0px)'
		});
		// 设置各个隐藏的按钮为收起的状态
		for (var i = len - 1; i >= 0; i--) {
			buttons[i].setStyle({
				'transition': 'transform ' + duration,
				'transform': 'translateX(0px)',
				'-webkit-transform': 'translateX(0px)'
			});
		}
	});
	setStatus('close', instance, ownerInstance);
}

// status的状态发生变化
function statusChange(newValue, oldValue, ownerInstance, instance) {
	var state = instance.getState();
	if (state.disabled) return
	// 打开或关闭单元格
	if (newValue === 'close' && state.status === 'open') {
		closeSwipeAction(instance, ownerInstance);
	} else if(newValue === 'open' && state.status === 'close') {
		openSwipeAction(instance, ownerInstance);
	}
}

// 菜单尺寸发生变化
function sizeChange(newValue, oldValue, ownerInstance, instance) {
	// wxs内的局部变量快照
	var state = instance.getState();
	state.disabled = newValue.disabled;
	state.duration = newValue.duration;
	state.show = newValue.show;
	state.threshold = newValue.threshold;
	state.buttons = newValue.buttons;

	if (state.buttons) {
		var len = state.buttons.length;
		var buttonsWidth = 0;
		var buttons = newValue.buttons;
		for (var i = 0; i < len; i++) {
			buttonsWidth += buttons[i].width;
		}
	}
	state.buttonsWidth = buttonsWidth;
}

const _sfc_wxs = {
	touchstart: touchstart,
	touchmove: touchmove,
	touchend: touchend,
	sizeChange: sizeChange,
	statusChange: statusChange
};

const block0 = Comp => {
  if(!Comp.$wxs){Comp.$wxs = [];} 
  Comp.$wxs.push('wxs');
  if(!Comp.mixins){Comp.mixins = [];}
  Comp.mixins.push({beforeCreate(){ this['wxs'] = _sfc_wxs; }});
};

/**
	 * SwipeActionItem 滑动单元格子组件
	 * @description 该组件一般用于左滑唤出操作菜单的场景，用的最多的是左滑删除操作
	 * @tutorial https://www.uvui.cn/components/swipeAction.html
	 * @property {Boolean}			show			控制打开或者关闭（默认 false ）
	 * @property {String | Number}	index			标识符，如果是v-for，可用index索引
	 * @property {Boolean}			disabled		是否禁用（默认 false ）
	 * @property {Boolean}			autoClose		是否自动关闭其他swipe按钮组（默认 true ）
	 * @property {Number}			threshold		滑动距离阈值，只有大于此值，才被认为是要打开菜单（默认 30 ）
	 * @property {Array}			options			右侧按钮内容
	 * @property {String | Number}	duration		动画过渡时间，单位ms（默认 350 ）
	 * @event {Function(index)}	open	组件打开时触发
	 * @event {Function(index)}	close	组件关闭时触发
	 * @example	<uv-swipe-action><uv-swipe-action-item :options="options1" ></uv-swipe-action-item></uv-swipe-action>
	 */
	const _sfc_main$2 = {
		name: 'uv-swipe-action-item',
		emits: ['click'],

		mixins: [mpMixin, mixin, props$1, touch],





		mixins: [mpMixin, mixin, props$1, touch, wxs],

		data() {
			return {
				// 按钮的尺寸信息
				size: {},
				// 父组件uv-swipe-action的参数
				parentData: {
					autoClose: true,
				},
				// 当前状态，open-打开，close-关闭
				status: 'close',
			}
		},
		watch: {
			// 由于wxs无法直接读取外部的值，需要在外部值变化时，重新执行赋值逻辑
			wxsInit(newValue, oldValue) {
				this.queryRect();
			}
		},
		computed: {
			wxsInit() {
				return [this.disabled, this.autoClose, this.threshold, this.options, this.duration]
			}
		},
		mounted() {



			this.init();
		},
		methods: {
			init() {
				// 初始化父组件数据
				this.updateParentData();

				this.$uv.sleep().then(() => {
					this.queryRect();
				});

			},
			updateParentData() {
				// 此方法在mixin中
				this.getParentData('uv-swipe-action');
			},

			// 查询节点
			queryRect() {
				this.$uvGetRect('.uv-swipe-action-item__right__button', true).then(buttons => {
					this.size = {
						buttons,
						show: this.show,
						disabled: this.disabled,
						threshold: this.threshold,
						duration: this.duration
					};
				});
			},

			// 按钮被点击
			buttonClickHandler(item, index) {
				this.$emit('click', {
					index,
					name: this.name
				});
			}
		},
	};

function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_uv_icon = resolveEasycom(resolveDynamicComponent("uv-icon"), __easycom_0);
  const _component_v_uni_text = index$i;
  const _component_v_uni_view = index$g;

  return (openBlock(), createBlock(_component_v_uni_view, {
    class: "uv-swipe-action-item",
    ref: "uv-swipe-action-item"
  }, {
    default: withCtx(() => [
      createVNode(_component_v_uni_view, { class: "uv-swipe-action-item__right" }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "button", {}, () => [
            (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index) => {
              return (openBlock(), createBlock(_component_v_uni_view, {
                key: index,
                class: "uv-swipe-action-item__right__button",
                ref_for: true,
                ref: `uv-swipe-action-item__right__button-${index}`,
                style: normalizeStyle([{
						alignItems: item.style && item.style.borderRadius ? 'center' : 'stretch'
					}]),
                onClick: $event => ($options.buttonClickHandler(item, index))
              }, {
                default: withCtx(() => [
                  createVNode(_component_v_uni_view, {
                    class: "uv-swipe-action-item__right__button__wrapper",
                    style: normalizeStyle([{
							backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
							borderRadius: item.style && item.style.borderRadius ? item.style.borderRadius : '0',
							padding: item.style && item.style.borderRadius ? '0' : '0 15px',
						}, item.style])
                  }, {
                    default: withCtx(() => [
                      (item.icon)
                        ? (openBlock(), createBlock(_component_uv_icon, {
                            key: 0,
                            name: item.icon,
                            color: item.style && item.style.color ? item.style.color : '#ffffff',
                            size: item.iconSize ? _ctx.$uv.addUnit(item.iconSize) : item.style && item.style.fontSize ? _ctx.$uv.getPx(item.style.fontSize) * 1.2 : 17,
                            customStyle: {
								marginRight: item.text ? '2px' : 0
							}
                          }, null, 8, ["name", "color", "size", "customStyle"]))
                        : createCommentVNode("", true),
                      (item.text)
                        ? (openBlock(), createBlock(_component_v_uni_text, {
                            key: 1,
                            class: "uv-swipe-action-item__right__button__wrapper__text uv-line-1",
                            style: normalizeStyle([{
								color: item.style && item.style.color ? item.style.color : '#ffffff',
								fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px',
								lineHeight: item.style && item.style.fontSize ? item.style.fontSize : '16px',
							}])
                          }, {
                            default: withCtx(() => [
                              createTextVNode(toDisplayString(item.text), 1)
                            ]),
                            _: 2
                          }, 1032, ["style"]))
                        : createCommentVNode("", true)
                    ]),
                    _: 2
                  }, 1032, ["style"])
                ]),
                _: 2
              }, 1032, ["style", "onClick"]))
            }), 128))
          ], true)
        ]),
        _: 3
      }),
      createVNode(_component_v_uni_view, {
        class: "uv-swipe-action-item__content",
        onTouchstart: _ctx.wxs.touchstart,
        onTouchmove: _ctx.wxs.touchmove,
        onTouchend: _ctx.wxs.touchend,
        status: $data.status,
        "change:status": _ctx.wxs.statusChange,
        size: $data.size,
        "change:size": _ctx.wxs.sizeChange
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default", {}, undefined, true)
        ]),
        _: 3
      }, 8, ["onTouchstart", "onTouchmove", "onTouchend", "status", "change:status", "size", "change:size"])
    ]),
    _: 3
  }, 512))
}
if (typeof block0 === 'function') block0(_sfc_main$2);
const __easycom_3 = /*#__PURE__*/_export_sfc(_sfc_main$2, [['render',_sfc_render$1],['__scopeId',"data-v-6b3a1ae1"]]);

const props = {
	props: {
		// 是否自动关闭其他swipe按钮组
		autoClose: {
			type: Boolean,
			default: true
		},
		...uni.$uv?.props?.swipeAction
	}
};

/**
	 * SwipeAction 滑动单元格 
	 * @description 该组件一般用于左滑唤出操作菜单的场景，用的最多的是左滑删除操作
	 * @tutorial https://www.uvui.cn/components/swipeAction.html
	 * @property {Boolean}	autoClose	是否自动关闭其他swipe按钮组
	 * @event {Function(index)}	click	点击组件时触发
	 * @example	<uv-swipe-action><uv-swipe-action-item :rightOptions="options1" ></uv-swipe-action-item></uv-swipe-action>
	 */
	const _sfc_main$1 = {
		name: 'uv-swipe-action',
		mixins: [mpMixin, mixin, props],
		data() {
			return {}
		},
		provide() {
			return {
				swipeAction: this
			}
		},
		computed: {
			// 这里computed的变量，都是子组件uv-swipe-action-item需要用到的，由于头条小程序的兼容性差异，子组件无法实时监听父组件参数的变化
			// 所以需要手动通知子组件，这里返回一个parentData变量，供watch监听，在其中去通知每一个子组件重新从父组件(uv-swipe-action-item)
			// 拉取父组件新的变化后的参数
			parentData() {
				return [this.autoClose]
			}
		},
		watch: {
			// 当父组件需要子组件需要共享的参数发生了变化，手动通知子组件
			parentData() {
				if (this.children.length) {
					this.children.map(child => {
						// 判断子组件(uv-swipe-action-item)如果有updateParentData方法的话，就就执行(执行的结果是子组件重新从父组件拉取了最新的值)
						typeof(child.updateParentData) === 'function' && child.updateParentData();
					});
				}
			},
		},
		created() {
			this.children = [];
		},
		methods: {
			closeOther(child) {
				if (this.autoClose) {
					// 历遍所有的单元格，找出非当前操作中的单元格，进行关闭
					this.children.map((item, index) => {
						if (child !== item) {
							item.closeHandler();
						}
					});
				}
			}
		}
	};

function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_v_uni_view = index$g;

  return (openBlock(), createBlock(_component_v_uni_view, { class: "uv-swipe-action" }, {
    default: withCtx(() => [
      renderSlot(_ctx.$slots, "default")
    ]),
    _: 3
  }))
}
const __easycom_4 = /*#__PURE__*/_export_sfc(_sfc_main$1, [['render',_sfc_render]]);

const _imports_0 = "/h5/static/images/edit.png";

const _sfc_main = {
  __name: 'address',
  setup(__props) {

	const main = useMainStore();
	const {
		isLogin,
		addresses,
		store,
		orderType
	} = storeToRefs(main);
	ref('我的地址');
	
	// 获取导航栏高度
	const { navbarHeightCss } = useNavbarHeight();

	const scene = ref('menu');
	const is_choose = ref(false);
	const swipeOption = ref(
		[{
			text: '删除',
			style: {
				backgroundColor: '#D12E32'
			}
		}]);

	onLoad((option) => {
		console.log('option:', option);
		is_choose.value = option.is_choose || false;
		scene.value = option.scene || 'menu';
	});
	onShow(() => {
		init();
	});

	const init = async () => {
		let data = await addressAll();
		if (data) {
			main.SET_ADDRESSES(data);
		}
	};
	const add = () => {
		navigateTo({
			url: '/pages/components/pages/address/add'
		});
	};
	const edit = (id) => {
		navigateTo({
			url: '/pages/components/pages/address/add?id=' + id
		});
	};
	const handleSwipeClick = async (id) => {
		let [error, res] = await showModal({
			title: '提示',
			content: '确定要删除？'
		});
		if (res && res.confirm) {
			let data = await addressDelete({
				id: id
			});
			if (data) {
				const index = addresses.value.findIndex(item => item.id == id);
				const newaddresses = JSON.parse(JSON.stringify(addresses.value));
				newaddresses.splice(index, 1);
				main.SET_ADDRESSES(newaddresses);
				showToast({
					title: '删除成功！',
					icon: 'success'
				});
			}
		}
	};
	const chooseAddress = async (address) => {
		if (!is_choose.value) {
			return;
		}

		console.log('scene.value:', scene.value);
		console.log("orderType", orderType.value);
		if (scene.value == 'menu' || scene.value == 'pay') {
			console.log(scene.value);
			console.log("main.store", main.store.value);
			if (orderType.value !== 'franchisees') {
				let data = await shopGetDistanceFromLocation({
					lat: address.latitude,
					lng: address.longitude,
					lat2: main.store.value.lat,
					lng2: main.store.value.lng
				});
				console.log("distance from location", data);
				if (!data) {
					return;
				}
				if (parseFloat(data) > store.value.distance) {
					showToast({
						title: '不在配送范围！',
						icon: 'error'
					});
					return;
				}
				// main.SET_ORDER_TYPE('takeout')
				main.store.far = data;
				main.store.far_text = data + 'km';
			}
			main.SET_ADDRESS(address);
			main.SET_STORE(main.store);
			main.SET_LOCATION({
				latitude: address.lat,
				longitude: address.lng
			});

			if (scene.value == 'menu') {
				switchTab({
					url: '/pages/menu/menu'
				});
			} else if (scene.value == 'pay') {
				navigateBack();
			}
		} else if (scene.value == 'scoreShop') {
			main.SET_ADDRESS(address);
			navigateBack();
		}
	};

return (_ctx, _cache) => {
  const _component_uv_empty = resolveEasycom(resolveDynamicComponent("uv-empty"), __easycom_4$1);
  const _component_v_uni_view = index$g;
  const _component_v_uni_image = index$q;
  const _component_uv_swipe_action_item = resolveEasycom(resolveDynamicComponent("uv-swipe-action-item"), __easycom_3);
  const _component_uv_swipe_action = resolveEasycom(resolveDynamicComponent("uv-swipe-action"), __easycom_4);
  const _component_v_uni_button = index$x;

  return (openBlock(), createBlock(_component_v_uni_view, {
    class: "container",
    style: normalizeStyle(`padding-top: ${unref(navbarHeightCss)};`)
  }, {
    default: withCtx(() => [
      createVNode(_component_v_uni_view, { class: "main" }, {
        default: withCtx(() => [
          (unref(addresses).length == 0)
            ? (openBlock(), createBlock(_component_uv_empty, {
                key: 0,
                mode: "address"
              }))
            : (openBlock(), createBlock(_component_uv_swipe_action, { key: 1 }, {
                default: withCtx(() => [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(addresses), (address, index) => {
                    return (openBlock(), createBlock(_component_uv_swipe_action_item, {
                      class: "address-wrapper",
                      options: swipeOption.value,
                      onClick: $event => (handleSwipeClick(address.id)),
                      key: index
                    }, {
                      default: withCtx(() => [
                        createVNode(_component_v_uni_view, {
                          class: "address",
                          onClick: $event => (chooseAddress(address))
                        }, {
                          default: withCtx(() => [
                            createVNode(_component_v_uni_view, { class: "left flex-fill overflow-hidden mr-20" }, {
                              default: withCtx(() => [
                                createVNode(_component_v_uni_view, {
                                  class: "font-size-lg font-weight-bold text-truncate",
                                  style: {"margin-bottom":"10rpx","white-space":"normal"}
                                }, {
                                  default: withCtx(() => [
                                    createTextVNode(toDisplayString(address.address + ' ' + address.detail), 1)
                                  ]),
                                  _: 2
                                }, 1024),
                                createVNode(_component_v_uni_view, { class: "font-size-sm text-color-assist" }, {
                                  default: withCtx(() => [
                                    createTextVNode(toDisplayString(address.realName) + " " + toDisplayString(address.isDefault ? '默认' : '') + " " + toDisplayString(address.phone), 1)
                                  ]),
                                  _: 2
                                }, 1024)
                              ]),
                              _: 2
                            }, 1024),
                            createVNode(_component_v_uni_image, {
                              src: _imports_0,
                              class: "edit-icon",
                              onClick: withModifiers($event => (edit(address.id)), ["stop"])
                            }, null, 8, ["onClick"])
                          ]),
                          _: 2
                        }, 1032, ["onClick"])
                      ]),
                      _: 2
                    }, 1032, ["options", "onClick"]))
                  }), 128))
                ]),
                _: 1
              }))
        ]),
        _: 1
      }),
      createVNode(_component_v_uni_view, { class: "btn-box" }, {
        default: withCtx(() => [
          createVNode(_component_v_uni_button, {
            type: "primary",
            size: "default",
            onClick: add
          }, {
            default: withCtx(() => [
              createTextVNode("新增地址")
            ]),
            _: 1
          })
        ]),
        _: 1
      })
    ]),
    _: 1
  }, 8, ["style"]))
}
}

};
const address = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-8074ded8"]]);

export { address as default };
